home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Lib / test / test_thread.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-06-23  |  3.6 KB  |  23 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. verbose
  5. done.acquire()
  6. for i in range(numtasks):
  7.     newtask()
  8.  
  9. print 'waiting for all tasks to complete'
  10. done.acquire()
  11. print 'all tasks done'
  12. print '\n*** Barrier Test ***'
  13. if done.acquire(0):
  14.     raise ValueError, "'done' should have remained acquired"
  15.  
  16. bar = barrier(numtasks)
  17. running = numtasks
  18. for i in range(numtasks):
  19.     thread.start_new_thread(task2, (i,))
  20.  
  21. done.acquire()
  22. print 'all tasks done'
  23.